﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MvcApplication.Common
{
    public static class HtmlExtension
    {
        public static MvcHtmlString IsSelected(this HtmlHelper html, object enumValue, string name)
        {
            if (((int)enumValue).ToString() == System.Web.HttpContext.Current.Request.QueryString[name])
            {
                return MvcHtmlString.Create("selected");
            }
            else
            {
                return null;
            }
        }

        public static MvcHtmlString GetRequest(this HtmlHelper html, string name)
        {
            return MvcHtmlString.Create(System.Web.HttpContext.Current.Request.QueryString[name]);
        }
    }
}